(function() {

    var width, height, largeHeader;

    // Main
    initHeader();

    function initHeader() {
        width = window.innerWidth;
        height = window.innerHeight;

        largeHeader = document.getElementById('large-header');
        largeHeader.style.height = height+'px';

    }
    $(".act-but").click(function(){
    	sub()
    });
    $(document).keydown(function(e) {
		if (e.keyCode == 13) {
			sub()
		}
	});
    
    $(window).on('resize', function() {
    	  initHeader();
    });
    
    //COOKIE 操作
    if ($.cookie('username')) {
		$("#rememberMe").attr("checked", true);
		$("#username").val($.cookie('username'));
		$("#password").val($.cookie('password'));
	}
    
    
})();
function sub(){
	if ($("#rememberMe").attr("checked")) {
		$.cookie('username', $("#username").val(),{
			expires : 7
		});
		$.cookie('password', $("#password").val(),{
			expires : 7
		});
	} else {
		$.cookie('username', "", {
			expires : -1
		});
		$.cookie('password', "", {
			expires : -1
		});
	}
	f.submit();
}
